
interface Printer{
    void print();
}

class BlackPrinter implements Printer{
    public String A;
    @Override
    public void print() {
        System.out.println("打印黑白文件！");
    }
}
class ColorPrinter implements Printer{
    public String B;
    @Override
    public void print() {
        System.out.println("打印彩色文件！");
    }
}
public class Test {
    public void print(Printer printer) {
        printer.print();
    }

    public static void main(String[] args) {
        Test test = new Test();
        test.print(new BlackPrinter());
        test.print(new ColorPrinter());
    }
}
//接口
interface A{
    int a = 10;
    void eat();
    /*public static final int a = 10;
    public abstract void eat();*/
    default public void SSS(){
        System.out.println("111");
    }
    public static void AAA(){
        System.out.println("222");
    }
}

//抽象类
/*abstract class A{
    //抽象方法
     public abstract void eat();

}*/
interface B{
    int b = 10;
}
class C{
    public String name;
}
//中间用逗号隔开
class D extends C implements A,B{
    @Override
    public void eat() {
        System.out.println("123");
    }
}

 class Test1 {
    public static void main(String[] args) {

    }
}
